package com.jiangnan.warehouse_management.pojo;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.sql.Timestamp;


@TableName("items")
@Data
public class Item {
    @TableId
    private Integer itemId;
    private String itemName;
    private Integer categoryId;
    private String specification;
    private String unit;
    private Integer minimumStock;
    private Integer maximumStock;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    @TableField(fill = FieldFill.INSERT) // 仅插入时填充
    private Timestamp createdAt;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "Asia/Shanghai")
    @TableField(fill = FieldFill.INSERT_UPDATE) // 插入和更新时都填充
    private Timestamp updatedAt;
}